﻿using System;
using System.Collections.Generic;
using SharpTrainer.Util;
using Zeus.Thunder.Core;

namespace SharpTrainer.Collections
{
    class HashSetTest : ITestCase
    {
        public void Run()
        {
            var people = new HashSet<MyEmployee>();
            people.Add(new MyEmployee("Bart", 1000));
            people.Add(new MyEmployee("Homer", 3800));
            people.Add(new MyEmployee("Lisa", 8000));
            people.Add(new MyEmployee("Marge", 3400));
            people.Add(new MyEmployee("Lisa", 8000)); // Duplicate will not be added.
            int four = people.Count;

            Console.WriteLine("List All Employees: ");
            Display(people);

            MyEmployee a = new MyEmployee("Lisa", 8000);
            MyEmployee b = new MyEmployee("Lisa", 8000);
            Console.WriteLine(a.Equals(b));
        }

        private void Display(HashSet<MyEmployee> set)
        {
            GenericUtil<MyEmployee>.PrintHashSet(set);
        }
    }
}
